package com.tbit.main.aop;

import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.annotation.AfterThrowing;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;

@Aspect
@Slf4j
public class ExceptionIntercept {

    @Pointcut("execution(* com.tbit.main.service.*.*(..))")
    public void anyMethod() {

    }

    @AfterThrowing(pointcut = "anyMethod()", throwing = "e")
    public void doAfterThrowing(RuntimeException e) {
        log.error("RuntimeException异常", e);
    }
}